﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using TLT.Models.ShopruviDatabase;
using TLT.Models.Views;
using TLT.Models.Entities;
using System.Data.Entity;

namespace shopruvi.Models
{
    public class Test
    {
        
        

        public void Add(LoaiDoiTuongView obj)
        {
           Database.SetInitializer(new DropCreateDatabaseIfModelChanges<ShopruviContext>());

            ShopruviContext db = new ShopruviContext();
            var con= db.Database.Connection.ConnectionString;
            db.LoaiDoiTuong.Add(new LoaiDoiTuong { Id = obj.Id, STT = obj.STT, Ma = obj.Ma, Ten = obj.Ten, GhiChu = obj.GhiChu });
            db.SaveChanges();
        }
    }
}